%include videoplayer src=src, osd=osd

<script type="text/javascript">
var _keyup = keyevents[keys.up];
function tvkeyup() {
	if($("#osd").is(":empty")) {
		update("body", "tv/watch/{{channelid + 1}}", true);
	}
	else {
		_keyup();
	}
}

var _keydown = keyevents[keys.down];
function tvkeydown() {
	if($("#osd").is(":empty")) {
		update("body", "tv/watch/{{channelid - 1}}", true);
	}
	else {
		_keydown();
	}
}

keyevents[keys.up] = tvkeyup;
keyevents[keys.down] = tvkeydown;
</script>
